﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Light.Weixin.Contract;
using Light.Framework.Castle;

namespace Light.Weixin.Model
{
    /// <summary>
    /// 微信消息的扩展方法
    /// </summary>
    public static class WxMsgExtension
    {
        /// <summary>
        /// 根据msg.Content 和 msg.ToUserName 获取自动回复消息内容
        /// </summary>
        /// <param name="msg">消息</param>
        /// <returns></returns>
        public static string GetAnswer(this WxMsg msg)
        {
            IWxAnswerComponent comp = ServerApplication.ComponentFactory.Create<IWxAnswerComponent>();
            return comp.GetAnswer(msg);
        }
    }
}
